package com.hzcx.app.simplechat.ui.group.bean;

import org.litepal.crud.LitePalSupport;

import java.io.Serializable;
import java.util.List;

import io.reactivex.annotations.Nullable;

public class GroupInfoBean extends LitePalSupport implements Serializable {
    /**
     * my
     * [object]	是
     * id
     * [number]	是		展开
     * hxchatgroup_id
     * [number]	是	群ID	展开
     * member_id
     * [number]	是	会员ID	展开
     * group_member_nickname
     * [string]	是	群昵称
     * is_owner复制
     * [string]	是	群主复制	展开
     * is_admin
     * [string]	是	管理员	展开
     * state
     * [string]	是	0=未进群,1=待审批,2=通过	展开
     * createtime
     * [number]	是		展开
     * updatetime
     * [number]	是		展开
     * member
     * [object]	是
     * avatar
     * [string]	是	头像
     * nickname
     * [string]	是	昵称
     * qrcodeimage
     * [string]	是	二维码
     * mobile
     * [string]	是	手机
     * hxusername
     * [string]	是	环信号
     * members
     * [array]	是
     * id
     * [number]	是		展开
     * hxchatgroup_id
     * [number]	是	群ID	展开
     * member_id
     * [number]	是	会员ID	展开
     * group_member_nickname
     * [string]	是	群昵称
     * is_owner
     * [string]	是	群主	展开
     * is_admin
     * [string]	是	管理员	展开
     * state
     * [string]	是	0=未进群,1=待审批,2=通过	展开
     * createtime
     * [number]	是		展开
     * updatetime
     * [number]	是		展开
     * member
     * [object]	是
     * avatar
     * [string]	是	头像
     * nickname
     * [string]	是	昵称
     * qrcodeimage
     * [string]	是	二维码
     * mobile
     * [string]	是	手机
     * hxusername
     * [string]	是	环信号
     * is_mute
     * [boolean]	是	是否被禁言
     * mute
     * [string]	是	禁言的毫秒数
     * mute_message1
     * [string]	是	禁言文字1
     * mute_message2
     * [string]	是	禁言文字2
     * group_placard
     * [string]	是	群组公告
     * group_desc
     * [string]	是	群组描述
     * group_scale
     * [string]	是	群组规模
     * group_name
     * [string]	是	群组名称
     * group_id
     * [string]	是	群id
     * hx_groupid
     * [string]	是	环信群id
     * group_name
     * [string]	是	群名称
     * group_image
     * [string]	是	群图片
     * group_qrcode
     * [string]	是	群二维码
     * join_mode
     * [string]	是	加群方式:0=不验证,1=需要验证,2需要验证加审核
     * allowinvites
     * [string]	是	允许邀请(单选):Y=是,N=否
     * group_property
     * [string]	是	群属性(单选):Y=通过ID或群名查找,N=不可被查找,F=仅通过ID查找
     * members_only
     * [string]	是	必须审批(单选):Y=是,N=否
     * question1
     * [string]	是	问题1
     * question2
     * [string]	是	问题1
     * question3
     * [string]	是	问题1
     * protectedswitch
     * [int]	是	群保护开关 0=关 1=开
     * UPDATE_PROFESSIONAL_TEXT
     * [string]	是	升级群文本
     * findWay
     * [string]	是	找群方式
     * join_mode_text_zh_cn
     * [string]	是	加群方式
     * admin_tips
     * [string]	是	管理提示
     * findswitch
     * [int]	是	找群开关 0=关 1=开
     * custom_number
     * [string]	是	自定义群号
     * lord_id
     * [string]	是	创建者ID
     * levelable
     * [boolean]	是	等级可用
     * level
     * [string]	是	群等级:normal=普通群,professional=专业群,vip=VIP群,test=试用群
     * mute
     * [boolean]	是	是否处于全员禁言状态。 - true：是； - （默认）false：否。
     * qrcodeswitch
     * [int]	是	二维码开关 0=关 1=开
     * urlswitch复制
     * [int]	是	url开关 0=关 1=开复制
     */


    private MembersBean my;
    private List<MembersBean> members;
    private String group_placard;
    private String group_desc;
    private String group_scale;
    private String group_name;
    private String group_id;
    private String hx_groupid;
    private String group_image;
    private String group_qrcode;
    private String join_mode;
    private String allowinvites;
    private String group_property;
    private String members_only;
    @Nullable
    private String question1;
    @Nullable
    private String question2;
    @Nullable
    private String question3;
    private int protectedswitch;
    private String UPDATE_PROFESSIONAL_TEXT;
    private String findWay;
    private String join_mode_text_zh_cn;
    private String admin_tips;
    private String findswitch;
    private String custom_number;
    private String lord_id;
    private String levelable;
    private String level;

    private String group_member_nickname;

    private boolean mute;
    private int qrcodeswitch;
    private int urlswitch;
    public String getGroup_member_nickname() {
        return group_member_nickname;
    }

    public void setGroup_member_nickname(String group_member_nickname) {
        this.group_member_nickname = group_member_nickname;
    }

    public int getMember_total() {
        return member_total;
    }

    public void setMember_total(int member_total) {
        this.member_total = member_total;
    }

    private int member_total;

    public int getMembersCount() {
        return membersCount;
    }

    public void setMembersCount(int membersCount) {
        this.membersCount = membersCount;
    }

    private int membersCount;   // 群成员个数

    public boolean isMute() {
        return mute;
    }

    public void setMute(boolean mute) {
        this.mute = mute;
    }

    public int getQrcodeswitch() {
        return qrcodeswitch;
    }

    public void setQrcodeswitch(int qrcodeswitch) {
        this.qrcodeswitch = qrcodeswitch;
    }

    public int getUrlswitch() {
        return urlswitch;
    }

    public void setUrlswitch(int urlswitch) {
        this.urlswitch = urlswitch;
    }

    public MembersBean getMy() {
        return my;
    }

    public void setMy(MembersBean my) {
        this.my = my;
    }

    public List<MembersBean> getMembers() {
        return members;
    }

    public void setMembers(List<MembersBean> members) {
        this.members = members;
        membersCount = members.size();
    }

    public String getGroup_placard() {
        return group_placard;
    }

    public void setGroup_placard(String group_placard) {
        this.group_placard = group_placard;
    }

    public String getGroup_desc() {
        return group_desc;
    }

    public void setGroup_desc(String group_desc) {
        this.group_desc = group_desc;
    }

    public String getGroup_scale() {
        return group_scale;
    }

    public void setGroup_scale(String group_scale) {
        this.group_scale = group_scale;
    }

    public String getGroup_name() {
        return group_name == null ? "" : group_name;
    }

    public void setGroup_name(String group_name) {
        this.group_name = group_name;
    }

    public String getGroup_id() {
        return group_id;
    }

    public void setGroup_id(String group_id) {
        this.group_id = group_id;
    }

    public String getHx_groupid() {
        return hx_groupid;
    }

    public void setHx_groupid(String hx_groupid) {
        this.hx_groupid = hx_groupid;
    }

    public String getGroup_image() {
        return group_image;
    }

    public void setGroup_image(String group_image) {
        this.group_image = group_image;
    }

    public String getGroup_qrcode() {
        return group_qrcode;
    }

    public void setGroup_qrcode(String group_qrcode) {
        this.group_qrcode = group_qrcode;
    }

    public String getJoin_mode() {
        return join_mode;
    }

    public void setJoin_mode(String join_mode) {
        this.join_mode = join_mode;
    }

    public String getAllowinvites() {
        return allowinvites;
    }

    public void setAllowinvites(String allowinvites) {
        this.allowinvites = allowinvites;
    }

    public String getGroup_property() {
        return group_property;
    }

    public void setGroup_property(String group_property) {
        this.group_property = group_property;
    }

    public String getMembers_only() {
        return members_only;
    }

    public void setMembers_only(String members_only) {
        this.members_only = members_only;
    }

    public String getQuestion1() {
        return question1;
    }

    public void setQuestion1(String question1) {
        this.question1 = question1;
    }

    public String getQuestion2() {
        return question2;
    }

    public void setQuestion2(String question2) {
        this.question2 = question2;
    }

    public String getQuestion3() {
        return question3;
    }

    public void setQuestion3(String question3) {
        this.question3 = question3;
    }

    public int getProtectedswitch() {
        return protectedswitch;
    }

    public void setProtectedswitch(int protectedswitch) {
        this.protectedswitch = protectedswitch;
    }

    public String getUPDATE_PROFESSIONAL_TEXT() {
        return UPDATE_PROFESSIONAL_TEXT;
    }

    public void setUPDATE_PROFESSIONAL_TEXT(String UPDATE_PROFESSIONAL_TEXT) {
        this.UPDATE_PROFESSIONAL_TEXT = UPDATE_PROFESSIONAL_TEXT;
    }

    public String getFindWay() {
        return findWay;
    }

    public void setFindWay(String findWay) {
        this.findWay = findWay;
    }

    public String getJoin_mode_text_zh_cn() {
        return join_mode_text_zh_cn;
    }

    public void setJoin_mode_text_zh_cn(String join_mode_text_zh_cn) {
        this.join_mode_text_zh_cn = join_mode_text_zh_cn;
    }

    public String getAdmin_tips() {
        return admin_tips;
    }

    public void setAdmin_tips(String admin_tips) {
        this.admin_tips = admin_tips;
    }

    public String getFindswitch() {
        return findswitch;
    }

    public void setFindswitch(String findswitch) {
        this.findswitch = findswitch;
    }

    public String getCustom_number() {
        return custom_number;
    }

    public void setCustom_number(String custom_number) {
        this.custom_number = custom_number;
    }

    public String getLord_id() {
        return lord_id;
    }

    public void setLord_id(String lord_id) {
        this.lord_id = lord_id;
    }

    public String getLevelable() {
        return levelable;
    }

    public void setLevelable(String levelable) {
        this.levelable = levelable;
    }

    public String getLevel() {
        return level;
    }

    public void setLevel(String level) {
        this.level = level;
    }

    public int getMember_id() {
        if (my == null) {
            return 0;
        }
        return my.getMember_id();
    }

    public boolean isOwner() {
        return my.getIs_owner().equals("Y");
    }
    public boolean isAdmin() {
        return my.getIs_owner().equals("Y");
    }
    public boolean hasAdminAuthority() {
        if (my == null) {
            return false;
        }
        return my.getIs_owner().equals("Y") || my.getIs_admin().equals("Y");
    }
}


